<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>管理后台</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="/admin/Public/admin/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/admin/Public/admin/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <script src="/admin/Public/admin/assets/js/echarts.min.js"></script>
    <link rel="stylesheet" href="/admin/Public/admin/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="/admin/Public/admin/assets/css/amazeui.datatables.min.css" />
    <link rel="stylesheet" href="/admin/Public/admin/assets/css/app.css">
    <script src="/admin/Public/admin/assets/js/jquery.min.js"></script>
    <script src="/admin/Public/admin/layer/layer.js"></script>
     <style>
    .pay{width:200px;height:200px;background:#ccc;z-index:2;margin:100px auto;position: relative;display:none;}
    .pay img{margin: 0px 0 0 0px;}
    ._page a{color:white}
    ._page {overflow:hidden;margin:0;padding:0;}
    ._page a{float:right;display:block;overflow:hidden;margin:5px;padding:3px 8px; border:1px solid white;}
    ._page a:hover{background-color:#333;color:white;}
    ._page a.current{background-color:#333;color:white;}
</style> 
<script type="text/javascript">
        $(function() {
                $('#chkall').click(function(){
                     $('input[name="id[]"]').prop('checked',$(this).is(':checked'));
                });
        });
</script>
</head>
<body data-type="widgets">
    <script src="/admin/Public/admin/assets/js/theme.js"></script>
    <div class="am-g tpl-g">
        <!-- 头部 -->
        <header>
            <!-- logo -->
            <div class="am-fl tpl-header-logo">
                <a href="javascript:;"><img src="/admin/Public/admin/assets/img/logo.png" alt=""></a>
            </div>
            <!-- 右侧内容 -->
            <div class="tpl-header-fluid">
                <!-- 侧边切换 -->
                <div class="am-fl tpl-header-switch-button am-icon-list">
                    <span>
                </span>
                </div>
                <!-- 搜索 -->
                <div class="am-fl tpl-header-search">
                    <form class="tpl-header-search-form" action="javascript:;">
                        <button class="tpl-header-search-btn am-icon-search"></button>
                        <input class="tpl-header-search-box" type="text" placeholder="搜索内容...">
                    </form>
                </div>
                <!-- 其它功能-->
                <div class="am-fr tpl-header-navbar">
                    <ul>
                        <!-- 欢迎语 -->
                        <li class="am-text-sm tpl-header-navbar-welcome">
                            <a href="javascript:;">欢迎你, <span><?php echo ($member["username"]); ?></span> </a>
                        </li>
                        <!-- 新邮件 -->
                        <li class="am-dropdown tpl-dropdown" data-am-dropdown>
                            <a href="javascript:;" class="am-dropdown-toggle tpl-dropdown-toggle" data-am-dropdown-toggle>
                                <i class="am-icon-envelope"></i>
                                <span class="am-badge am-badge-success am-round item-feed-badge">4</span>
                            </a>
                            <!-- 弹出列表 -->
                            <ul class="am-dropdown-content tpl-dropdown-content">
                                <li class="tpl-dropdown-menu-messages">
                                    <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                        <div class="menu-messages-ico">
                                            <img src="/admin/Public/admin/assets/img/user04.png" alt="">
                                        </div>
                                        <div class="menu-messages-time">
                                            3小时前
                                        </div>
                                        <div class="menu-messages-content">
                                            <div class="menu-messages-content-title">
                                                <i class="am-icon-circle-o am-text-success"></i>
                                                <span>夕风色</span>
                                            </div>
                                            <div class="am-text-truncate"> Amaze UI 的诞生，依托于 GitHub 及其他技术社区上一些优秀的资源；Amaze UI 的成长，则离不开用户的支持。 </div>
                                            <div class="menu-messages-content-time">2016-09-21 下午 16:40</div>
                                        </div>
                                    </a>
                                </li>
                                <li class="tpl-dropdown-menu-messages">
                                    <a href="javascript:;" class="tpl-dropdown-menu-messages-item am-cf">
                                        <i class="am-icon-circle-o"></i> 进入列表…
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <!-- 新提示 -->
                        <li class="am-dropdown" data-am-dropdown>
                            <a href="javascript:;" class="am-dropdown-toggle" data-am-dropdown-toggle>
                                <i class="am-icon-bell"></i>
                                <span class="am-badge am-badge-warning am-round item-feed-badge">5</span>
                            </a>
                            <!-- 弹出列表 -->
                            <ul class="am-dropdown-content tpl-dropdown-content">
                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <div class="tpl-dropdown-menu-notifications-title">
                                            <i class="am-icon-line-chart"></i>
                                            <span> 有6笔新的销售订单</span>
                                        </div>
                                        <div class="tpl-dropdown-menu-notifications-time">
                                            12分钟前
                                        </div>
                                    </a>
                                </li>
                                <li class="tpl-dropdown-menu-notifications">
                                    <a href="javascript:;" class="tpl-dropdown-menu-notifications-item am-cf">
                                        <i class="am-icon-bell"></i> 进入列表…
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <!-- 退出 -->
                        <li class="am-text-sm">
                            <a href="<?php echo U('Public/logout');?>" onclick="return chkget(this);">
                                <span class="am-icon-sign-out"></span> 退出
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </header>
        <!-- 风格切换 -->
        <div class="tpl-skiner">
            <div class="tpl-skiner-toggle am-icon-cog">
            </div>
            <div class="tpl-skiner-content">
                <div class="tpl-skiner-content-title">
                    选择主题
                </div>
                <div class="tpl-skiner-content-bar">
                    <span class="skiner-color skiner-white" data-color="theme-white"></span>
                    <span class="skiner-color skiner-black" data-color="theme-black"></span>
                </div>
            </div>
        </div>
        <!-- 侧边导航栏 -->
        <div class="left-sidebar">
            <!-- 用户信息 -->
            <div class="tpl-sidebar-user-panel">
                <div class="tpl-user-panel-slide-toggleable">
                    <div class="tpl-user-panel-profile-picture">
                        <img src="/admin/Public/admin/assets/img/user04.png" alt="">
                    </div>
                    <span class="user-panel-logged-in-text">
              <i class="am-icon-circle-o am-text-success tpl-user-panel-status-icon"></i>
              <?php echo ($member["nickname"]); ?>
          </span>
                    <a href="<?php echo U('Member/my');?>" class="tpl-user-panel-action-link"> <span class="am-icon-pencil"></span> 账号设置</a>
                </div>
            </div>
 <!-- 菜单 -->
            <ul class="sidebar-nav">
              <?php if(is_array($menu)): $i = 0; $__LIST__ = $menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li class="sidebar-nav-link">
                    <a href="javascript:;" class="sidebar-nav-sub-title" >
                        <i class="am-icon-table sidebar-nav-link-logo"></i> <?php echo ($menu["menu_name"]); ?>
                        <span class="am-icon-chevron-down am-fr am-margin-right-sm sidebar-nav-sub-ico"></span>
                    </a>
                    <ul class="sidebar-nav sidebar-nav-sub" <?php if($parent == $menu['id']): ?>style="display:block"<?php endif; ?>>
                        <?php if(is_array($menu["child"])): $i = 0; $__LIST__ = $menu["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><li class="sidebar-nav-link" >
                            <a href="<?php echo U($vo['linkurl']);?>" <?php if($menu_name['linkurl'] == $vo['linkurl']): ?>style="color:white"<?php endif; ?>>
                                <span class="am-icon-angle-right sidebar-nav-link-logo"></span><?php echo ($vo["menu_name"]); ?>
                            </a>
                        </li><?php endforeach; endif; else: echo "" ;endif; ?>
                    </ul>
                </li><?php endforeach; endif; else: echo "" ;endif; ?>
            </ul>
        </div>


        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">

            <div class="container-fluid am-cf">
                <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-9">
                        <div class="page-header-heading" style="height:10px;">
                            <small>您当前的位置：</small>
                            <?php echo ((isset($menu_name["menu_name"]) && ($menu_name["menu_name"] !== ""))?($menu_name["menu_name"]):''); ?>
                            <small><a href="<?php echo U('Index/index');?>"><font color="#f0f8ff">&nbsp;&nbsp;&nbsp;&nbsp;回到首页</font></a></small>
                        </div>
                    </div>
                </div>

            </div>
         <div class="row-content am-cf">
      <div class="row">
                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">添加菜单</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">
                                <form class="am-form tpl-form-line-form" action="<?php echo U();?>" method="post" onsubmit="return chkform(this);">
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">菜单名称<span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input"  placeholder="请输入菜单名称" name="menu_name">
                                            <small>菜单名称为必填</small>
                                        </div>
                                    </div>     
                                    <div class="am-form-group">
                                        <label for="user-name" class="am-u-sm-3 am-form-label">链接地址<span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-9">
                                            <input type="text" class="tpl-form-input"  placeholder="请输入链接地址" name="linkurl">
                                            <small>可留空</small>
                                        </div>
                                    </div>                  
                                    <div class="am-form-group">
                                        <label for="user-phone" class="am-u-sm-3 am-form-label">上级菜单 <span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-9">
                                            <select data-am-selected="{searchBox: 1}" style="display: none;" name="pid">
                                              <option value="0">顶级菜单</option>
                                              <?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["id"]); ?>"><?php echo ($vo["menu_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="am-form-group">
                                        <label for="user-intro" class="am-u-sm-3 am-form-label">是否显示</label>
                                        <div class="am-u-sm-9">
                                            <div class="tpl-switch">
                                                <input type="checkbox" class="ios-switch bigswitch tpl-switch-btn" checked="" name="hide">
                                                <div class="tpl-switch-btn-view">
                                                    <div>
                                                    </div>
                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                  <div class="am-form-group">
                                        <div class="am-u-sm-9 am-u-sm-push-3">
                                            <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
</div>
         </div>
    </div>
    </div>
    <script src="/admin/Public/admin/assets/js/amazeui.min.js"></script>
    <script src="/admin/Public/admin/assets/js/amazeui.datatables.min.js"></script>
    <script src="/admin/Public/admin/assets/js/dataTables.responsive.min.js"></script>
    <script src="/admin/Public/admin/assets/js/app.js"></script>
    <script>
        function zhankai(){
            $('.sidebar-nav sidebar-nav-sub').attr('display','block');
        }
        //post ajax提交
    function chkform(the){
    var msg = "您真的确定要做此操作吗？\n\n请确认！";
    if (confirm(msg)==true){
      var that = $(the);
      var url= $(the).attr('action');
      var cs = $(the).serialize();
      $.ajax({
          url:url,
          data:cs,
          type:'POST',
          success: function(data){
              if(data.status==1){
                  layer.msg(data.info);
                  var timer = setInterval(function(){
                      clearInterval(timer);
                      window.location.href=data.url;
                  },2000);
              }else{
                  layer.msg(data.info);
              }
          }
      });
  }else{
      return false;
  }
  return false;
    }

        //get方法ajax提交
    function chkget(the){
        var msg = "您真的确定要进行此操作吗？\n\n请确认！";
        if (confirm(msg)==true){
            var url = $(the).attr('href');
            //alert(url);
            $.ajax({
                url:url,
                type:'GET',
                success:function(data){
                    if(data.status==1){
                        layer.msg(data.info);
                        var timer = setInterval(function(){
                            clearInterval(timer);
                            window.location.href=data.url;
                        },2000);
                    }else{
                        layer.msg(data.info);
                    }
                }
            });
        }else{
            return false;
        }
        return false;
    }
    </script>
</body>

</html>